
<template>
  <div class="comment">
    <span>短评</span>
    <div class="tags">
      <!-- mpvue暂时不支持slot内容分发插槽 -->
      <Tag v-for="(item, index) in spliceCommentArr" :key="index" :tagItem="item" :itemIndex="index"></Tag>
    </div>
  </div>
</template>

<script>
import Tag from '../../../components/tag/index'
export default {
  props: ['commentArr'],
  components: { Tag },
  computed: {
    spliceCommentArr () {
      // 展示8个短评
      return this.commentArr.slice(0, 8)
    }
  }
};
</script>

<style scoped>
.comment {
  background-color: #fff;
  text-align: center;
  padding: 10rpx;
}
.tags {
  display: flex;
  flex-wrap: wrap;
}
</style>